﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MemberMultiplePicker.aspx.cs" Inherits="ZHDJ.Web.App.Share.Picker.MemberMultiplePicker" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
</head>
<body>
    <form id="form1" runat="server">

        <f:PageManager ID="PageManager1" runat="server" AutoSizePanelID="Panel4" />
        <f:Panel ID="Panel4" runat="server" ShowBorder="True" EnableCollapse="true"
            Layout="HBox" BoxConfigAlign="Stretch" BoxConfigPosition="Start"
            BoxConfigChildMargin="0 0 0 0" BodyPadding="5px" ShowHeader="false">
            <Toolbars>
                <f:Toolbar ID="Toolbar3" runat="server">
                    <Items>
                        <f:TwinTriggerBox ID="ttbSearchMessage" Width="300px" runat="server" ShowLabel="false"
                            EmptyText="在用户名、手机号码中搜索" Trigger1Icon="Clear" Trigger2Icon="Search" ShowTrigger1="false"
                            OnTrigger2Click="ttbSearchMessage_Trigger2Click"  OnTrigger1Click="ttbSearchMessage_Trigger1Click">
                        </f:TwinTriggerBox>
                    </Items>
                </f:Toolbar>
                <f:Toolbar ID="Toolbar5" runat="server" Position="Bottom" ToolbarAlign="Center">
                    <Items>


                        <f:Button ID="Button3" ValidateForms="SimpleForm1" Icon="SystemSaveClose" OnClick="btnSaveClose_Click"
                            runat="server" Text="选择后关闭">
                        </f:Button>
                        <f:ToolbarSeparator ID="ToolbarSeparator2" runat="server">
                        </f:ToolbarSeparator>
                        <f:Button ID="btnClose" Icon="SystemClose" EnablePostBack="false" runat="server"
                            Text="关闭">
                        </f:Button>
                    </Items>
                </f:Toolbar>
            </Toolbars>
            <Items>

                <f:Panel ID="Panel1" runat="server" BoxFlex="3"
                    ShowBorder="false" ShowHeader="false" Layout="Fit" Margin="0 5 0 0">
                    <Items>
                        <f:Tree ID="TreeBranch" EnableCollapse="true" ShowBorder="true"
                            ShowHeader="false" Title="组织" OnNodeCommand="TreeBranch_NodeCommand" runat="server">
                        </f:Tree>
                    </Items>
                </f:Panel>
                <f:Panel ID="Panel2" Title="面板3" BoxFlex="5" runat="server" Layout="Fit" Margin="0 5 0 0"
                    ShowBorder="false" ShowHeader="false">
                    <Items>
                        <f:Grid ID="Grid1" runat="server" ShowBorder="true" ShowHeader="false"
                            EnableCheckBoxSelect="true"
                            DataKeyNames="LoginID,UserName" AllowSorting="false" SortField="UserName"
                            SortDirection="DESC" AllowPaging="true" IsDatabasePaging="true"
                            OnRowCommand="Grid1_RowCommand" ShowPagingMessage="false">

                            <Toolbars>
                                <f:Toolbar ID="Toolbar1" runat="server">
                                    <Items>

                                        <f:Button ID="btnAddUsers" Icon="GroupEdit" EnablePostBack="false" runat="server"
                                            Text="选择用户">
                                            <Menu runat="server">
                                                <f:MenuButton ID="btnAddSelectUsers" OnClick="btnAddSelectUsers_Click" runat="server" Text="选择选中用户">
                                                </f:MenuButton>
                                                <f:MenuButton ID="btnAddAllUsers" OnClick="btnAddAllUsers_Click" runat="server"
                                                    Text="选择当前组织用户">
                                                </f:MenuButton>
                                            </Menu>
                                        </f:Button>

                                    </Items>
                                </f:Toolbar>
                            </Toolbars>

                            <Columns>
                                <f:RowNumberField Width="35px" />
                                <f:BoundField DataField="UserName" SortField="UserName" ExpandUnusedSpace="true" HeaderText="用户名" />
                                <f:TemplateField Width="50px">
                                    <ItemTemplate>
                                        <asp:Label ID="Label3" runat="server" Text='<%# GetGender(Eval("Gender")) %>'></asp:Label>
                                    </ItemTemplate>
                                </f:TemplateField>
                                <f:LinkButtonField ColumnID="deleteField2" TextAlign="Center" Icon="Add" ToolTip="选择"
                                    CommandName="Select" Width="50px" />
                            </Columns>
                        </f:Grid>

                    </Items>
                </f:Panel>
                <f:Panel ID="Panel3" Title="面板3" BoxFlex="4" runat="server" Layout="Fit"
                    ShowBorder="false" ShowHeader="false">
                    <Items>
                        <f:Grid ID="GridSelect" runat="server" ShowBorder="true" ShowHeader="false"
                            EnableCheckBoxSelect="true" BodyPadding="0"
                            DataKeyNames="LoginID1,UserName1" AllowSorting="false" SortField="UserName1"
                            SortDirection="DESC" AllowPaging="false" IsDatabasePaging="true"
                            OnRowCommand="GridSelect_RowCommand">
                            <Toolbars>
                                <f:Toolbar ID="Toolbar2" runat="server">
                                    <Items>

                                        <f:Button ID="Button1" Icon="GroupEdit" EnablePostBack="false" runat="server"
                                            Text="移除已选择的用户">
                                            <Menu runat="server">
                                                <f:MenuButton ID="btnRemoveSelectUsers" OnClick="btnRemoveSelectUsers_Click" runat="server" Text="移除选中用户">
                                                </f:MenuButton>
                                                <f:MenuButton ID="btnRemoveAllUsers" OnClick="btnRemoveAllUsers_Click" runat="server"
                                                    Text="移除所有用户">
                                                </f:MenuButton>
                                            </Menu>
                                        </f:Button>


                                    </Items>
                                </f:Toolbar>
                            </Toolbars>

                            <Columns>
                                <f:RowNumberField Width="35px" ColumnID="dd" />
                                <f:BoundField DataField="UserName1" SortField="UserName1" ExpandUnusedSpace="true" HeaderText="用户名" />

                                <f:LinkButtonField ColumnID="deleteField" Icon="Delete" ToolTip="移除"
                                    CommandName="Remove" Width="50px" />
                            </Columns>
                        </f:Grid>

                    </Items>
                </f:Panel>
            </Items>
        </f:Panel>
        <f:HiddenField ID="hdParentBranchID" runat="server">
        </f:HiddenField>
        <f:HiddenField ID="hdSelectUsers" runat="server">
        </f:HiddenField>
        <f:HiddenField ID="hdSelectUsersID" runat="server">
        </f:HiddenField>
    </form>
</body>
</html>
<script type="text/javascript">
    function renderGender(value) {
        if (value=="1") {
            return "女";
        } else if (value == "0") {
            return "男";
        }
        return "未知";
    }
</script>
